#include <bits/stdc++.h>
using namespace std;
double sb, is, me;
int fuck, you, tube, baby;
int main()
{
    cin >> sb >> is;
    fuck = 8 * 60 + 24 * 60, tube = ceil(sb / is) + 10, fuck -= tube;
    if (fuck >= 24 * 60)
        fuck -= 24 * 60;
    baby = fuck % 60, you = fuck / 60;
    if (you < 10)
    {
        if (baby < 10)
            cout << "0" << you << ":0" << baby;
        else
            cout << "0" << you << ":" << baby;
    }
    else
    {
        if (baby < 10)
            cout << you << ":0" << baby;
        else
            cout << you << ":" << baby;
    }
    return 0;
}